#ifndef _KEYBOARD_H
#define _KEYBOARD_H
#include "types.h"

#define KEY_COUNT   5           //total key counts
#define KEY_SCAN_PERIOD     10  //ms, key board sanning period
#define KEY_DELAY_COUNT     3   //delay time for key vibrate, UINT: KEY_SCAN_PERIOD

/*Key scanning packet defination*/
typedef struct
{
    UINT8 tick;         
    UINT8 scanvalid;    
    UINT8 state_last;   
    UINT8 keyvalue;    
    UINT8 keychanged;
    UINT8 keydelay[KEY_COUNT];
}KEYPKT;

/*SW index defination*/
#define SW_1        0x01
#define SW_2        0x02
#define SW_3        0x04
#define SW_4        0x08
#define SW_5        0x10

/*EXTERN VARIABLES*/
extern volatile  KEYPKT     g_Key;

/*EXTERN FUNCTIONS*/
void KeyBoardScan( void );

#endif

